/**
 * 
 */
package org.sensmon.core;

import java.util.List;

import org.extdev.device.ltr.LTRCrate;
import org.extdev.device.ltr.LTRLibServer;
import org.extdev.libraries.ltr.LTRException;
import org.sensmon.core.datamodel.GlobalContext;

/**
 * @author LAP
 *
 */
public class Inicilizer {
	private Inicilizer() {};
	
	public static void inicilize() {
		loadCrates();
	}
	
	private static void loadCrates() {
		try {
			GlobalContext.getInstance().setValue(new LTRLibServer());
		} catch (LTRException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static List<LTRCrate> getCrates() throws Exception {
		return ((LTRLibServer)GlobalContext.getInstance().getValue(LTRLibServer.class)).getCrates();
	}
}
